<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/basicinfo/goods_info/q_goods_info.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/basicinfo/goods_info/q_goods_info.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Item_id',
                footer: "Foots",
                cnName: '商品信息',
                name: 'goods_info/q_goods_info',
                url: "/q_goods_info/",
                sortName: "Item_sub"
            });
            const editFormFields = ref({"Item_sub":"","Item_name":"","Item_clsno":[],"Item_brand":"","Item_brandname":"","Unit_no":"","Item_size":"","Item_subno":"","Price_in":"","Product_area":"","Base_price1":"","Sale_price":"","Stock":"","Display_flag":"","Supplier":"","Barcode":"","Packing_unit":"","Cost_accounting":"","Valid_day":"","Abc":"","Tax_rate":"","Remark":"","glkc":"","Googs_image":"","attachment":""});
            const editFormOptions = ref([[{"title":"商品编号","required":true,"field":"Item_sub","disabled":true},
                               {"title":"商品名称","required":true,"field":"Item_name"},
                               {"dataKey":"商品分类","data":[],"title":"类别","required":true,"field":"Item_clsno","type":"cascader"},
                               {"title":"品牌","field":"Item_brand"}],
                              [{"dataKey":"商品属性","data":[],"title":"属性","required":true,"field":"Item_brandname","type":"select"},
                               {"dataKey":"商品单位","data":[],"title":"基本单位","required":true,"field":"Unit_no","type":"select"},
                               {"title":"规格","field":"Item_size"},
                               {"title":"货号","field":"Item_subno"}],
                              [{"dataKey":"city","data":[],"title":"产地","required":true,"field":"Product_area","type":"select"},
                               {"title":"采购价","field":"Price_in","type":"decimal"},
                               {"title":"最低售价","field":"Base_price1","type":"decimal"},
                               {"title":"零售价","field":"Sale_price","type":"decimal"}],
                              [{"dataKey":"往来标志","data":[],"title":"停用标志","required":true,"field":"Display_flag","type":"select"},
                               {"dataKey":"供应商客户","data":[],"title":"供应商","required":true,"field":"Supplier","type":"select"},
                               {"title":"主条码","field":"Barcode"},
                               {"title":"库存","field":"Stock","type":"text"}],
                              [{"title":"有效期","field":"Valid_day","type":"datetime"},
                               {"dataKey":"ABC级","data":[],"title":"ABC级","required":true,"field":"Abc","type":"select"},
                               {"dataKey":"成本核算方式","data":[],"title":"成本核算方式","required":true,"field":"Cost_accounting","type":"select"},
                               {"title":"包装量","field":"Packing_unit","type":"text"}],
                              [{"dataKey":"税率","data":[],"title":"税率","required":true,"field":"Tax_rate","type":"select"},
                               {"dataKey":"enable","data":[],"title":"是否管理库存","required":true,"field":"glkc","type":"select"},
                               {"title":"备注","field":"Remark","colSize":6,"type":"textarea"}],
                              [{"title":"产品图片","field":"Googs_image","type":"img"},
                               {"title":"产品附件","field":"attachment","type":"file"}]]);
            const searchFormFields = ref({"Item_sub":"","Item_name":"","Item_clsno":[],"Item_brandname":"","Item_subno":"","Display_flag":"","Supplier":"","Cost_accounting":"","AuditStatus":"","CreateDate":""});
            const searchFormOptions = ref([[{"title":"商品编号","field":"Item_sub","type":"like"},{"title":"商品名称","field":"Item_name","type":"like"},{"dataKey":"商品分类","data":[],"title":"类别","field":"Item_clsno","type":"cascader"},{"dataKey":"商品属性","data":[],"title":"属性","field":"Item_brandname","type":"select"}],[{"dataKey":"往来标志","data":[],"title":"停用标志","field":"Display_flag","type":"select"},{"dataKey":"供应商客户","data":[],"title":"供应商","field":"Supplier","type":"select"},{"title":"货号","field":"Item_subno","type":"like"},{"dataKey":"成本核算方式","data":[],"title":"成本核算方式","field":"Cost_accounting","type":"select"}],[{"dataKey":"audit","data":[],"title":"审核状态","field":"AuditStatus","type":"select"},{"title":"创建时间","field":"CreateDate","type":"datetime"}]]);
            const columns = ref([{field:'Item_id',title:'ID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'Item_sub',title:'商品编号',type:'string',width:110,readonly:true,require:true,align:'left',sort:true},
                       {field:'Item_name',title:'商品名称',type:'string',link:true,width:200,require:true,align:'left'},
                       {field:'Item_clsno',title:'类别',type:'guid',bind:{ key:'商品分类',data:[]},width:110,require:true,align:'left'},
                       {field:'Item_brand',title:'品牌',type:'string',width:220,align:'left'},
                       {field:'Item_brandname',title:'属性',type:'int',bind:{ key:'商品属性',data:[]},width:110,require:true,align:'left'},
                       {field:'Unit_no',title:'基本单位',type:'string',bind:{ key:'商品单位',data:[]},width:110,require:true,align:'left'},
                       {field:'Item_size',title:'规格',type:'string',width:110,align:'left'},
                       {field:'Packing_unit',title:'包装量',type:'float',width:80,align:'left'},
                       {field:'Item_subno',title:'货号',type:'string',width:110,align:'left'},
                       {field:'Stock',title:'库存',type:'int',width:110,align:'left'},
                       {field:'Price_in',title:'采购价',type:'decimal',width:110,align:'left'},
                       {field:'Product_area',title:'产地',type:'string',bind:{ key:'city',data:[]},width:220,require:true,align:'left'},
                       {field:'Base_price1',title:'最低售价',type:'decimal',width:110,align:'left'},
                       {field:'Sale_price',title:'零售价',type:'decimal',width:110,align:'left'},
                       {field:'Tax_rate',title:'税率',type:'decimal',bind:{ key:'税率',data:[]},width:80,require:true,align:'left'},
                       {field:'Display_flag',title:'停用标志',type:'int',bind:{ key:'往来标志',data:[]},width:110,require:true,align:'left'},
                       {field:'Supplier',title:'供应商',type:'int',bind:{ key:'供应商客户',data:[]},width:220,require:true,align:'left'},
                       {field:'Barcode',title:'主条码',type:'string',width:220,align:'left'},
                       {field:'Cost_accounting',title:'成本核算方式',type:'int',bind:{ key:'成本核算方式',data:[]},width:150,require:true,align:'left'},
                       {field:'Valid_day',title:'有效期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Abc',title:'ABC级',type:'int',bind:{ key:'ABC级',data:[]},width:110,require:true,align:'left'},
                       {field:'Googs_image',title:'产品图片',type:'img',width:110,align:'left'},
                       {field:'attachment',title:'产品附件',type:'file',width:110,align:'left'},
                       {field:'Remark',title:'备注',type:'string',width:220,align:'left'},
                       {field:'AuditDate',title:'审核时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'AuditStatus',title:'审核状态',type:'int',bind:{ key:'audit',data:[]},width:110,align:'left'},
                       {field:'AuditID',title:'审核人员id',type:'int',width:110,hidden:true,align:'left'},
                       {field:'Auditor',title:'审核人员',type:'string',width:120,hidden:true,align:'left'},
                       {field:'CreateID',title:'创建人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Creator',title:'创建人员',type:'string',width:100,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'ModifyID',title:'修改人员id',type:'int',width:100,hidden:true,align:'left'},
                       {field:'Modifier',title:'修改人员',type:'string',width:100,hidden:true,align:'left'},
                       {field:'ModifyDate',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'y_item_no',title:'原系统编码',type:'string',width:110,align:'left'},
                       {field:'glkc',title:'是否管理库存',type:'int',bind:{ key:'enable',data:[]},width:80,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
